import Cookies from "js-cookie";
let seconds = 300; //5分钟过期
let expires = new Date(new Date() * 1 + seconds * 1000);
const AdminUserIdKey = "AdminUserId";
export function setAdminUserId(AdminUserId) {
  return Cookies.set(AdminUserIdKey, AdminUserId);
}
export function getAdminUserId() {
  return Cookies.get(AdminUserIdKey);
}
export function delAdminUserId() {
  return Cookies.remove(AdminUserIdKey);
}

const TokenKey = "AdminToken";
export function setAdminToken(AdminToken) {
  return Cookies.set(TokenKey, AdminToken);
}
export function getAdminToken() {
  return Cookies.get(TokenKey);
}
export function delAdminToken() {
  return Cookies.remove(TokenKey);
}

const UsernameKey = "AdminUsername";
export function setUsername(username) {
  return Cookies.set(UsernameKey, username, { expires: 1 });
}
export function getUsername() {
  return Cookies.get(UsernameKey);
}
export function delUsername() {
  return Cookies.remove(UsernameKey);
}

const NicknameKey = "AdminNickname";
export function setNickname(nickname) {
  return Cookies.set(NicknameKey, nickname, { expires: 1 });
}
export function getNickname() {
  return Cookies.get(NicknameKey);
}
export function delNickname() {
  return Cookies.remove(NicknameKey);
}

const Gender = "Gender";
export function setGender(GenderData) {
  return Cookies.set(Gender, GenderData, { expires: 1 });
}
export function getGender() {
  return Cookies.get(Gender);
}
export function delGender() {
  return Cookies.remove(Gender);
}

const AvatarKey = "AdminAvatar";
export function setAvatar(username) {
  return Cookies.set(AvatarKey, username, { expires: 1 });
}
export function getAvatar() {
  return Cookies.get(AvatarKey);
}
export function delAvatar() {
  return Cookies.remove(AvatarKey);
}

const UseridKey = "UseridKey";
export function setUserid(userid) {
  return Cookies.set(UseridKey, userid, {
    expires: 7,
  });
}
export function getUserid() {
  return Cookies.get(UseridKey);
}
export function delUserid() {
  return Cookies.remove(UseridKey);
}

const Userpassword = "password";
export function setUserpassword(username) {
  return Cookies.set(Userpassword, username, {
    expires: 7,
  });
}
export function getUserpassword() {
  return Cookies.get(Userpassword);
}
export function delUserpassword() {
  return Cookies.remove(Userpassword);
}
const url = "url";
export function seturl(urlData) {
  return Cookies.set(url, urlData, {
    expires: 7,
  });
}
export function geturl() {
  return Cookies.get(url);
}
export function delurl() {
  return Cookies.remove(url);
}
const subject_id = "subject_id";
export function setsubject_id(subject_idlData) {
  return window.sessionStorage.setItem(subject_id, subject_idlData);
}
export function getsubject_id() {
  return window.sessionStorage.getItem(subject_id);
}
export function delsubject_id() {
  return window.sessionStorage.removeItem(subject_id);
}
const subjectTitle = "subjectTitle";
export function setsubjectTitle(subjectTitleData) {
  return window.sessionStorage.setItem(subjectTitle, subjectTitleData);
}
export function getsubjectTitle() {
  return window.sessionStorage.getItem(subjectTitle);
}
export function delsubjectTitle() {
  return window.sessionStorage.removeItem(subjectTitle);
}
const GZ = "GZ";
export function setGZ(GZData) {
  return Cookies.set(GZ, GZData, { expires: 1 });
}
export function getGZ() {
  return Cookies.get(GZ);
}
export function delGZ() {
  return Cookies.remove(GZ);
}
const Ti = "Ti";
export function setTi(TiData) {
  return window.localStorage.setItem(Ti, JSON.stringify(TiData));
}
export function getTi() {
  return JSON.parse(window.localStorage.getItem(Ti));
}
export function delTi() {
  return window.localStorage.removeItem(Ti);
}
const Ti1 = "Ti1";
export function setTi1(TiData) {
  return window.localStorage.setItem(Ti1, JSON.stringify(TiData));
}
export function getTi1() {
  return JSON.parse(window.localStorage.getItem(Ti1));
}
export function delTi1() {
  return window.localStorage.removeItem(Ti1);
}
const Ti2 = "Ti2";
export function setTi2(TiData) {
  return window.localStorage.setItem(Ti2, JSON.stringify(TiData));
}
export function getTi2() {
  return JSON.parse(window.localStorage.getItem(Ti2));
}
export function delTi2() {
  return window.localStorage.removeItem(Ti2);
}

const Agent = "Agent";
export function setAgent(AgentData) {
  return Cookies.set(Agent, AgentData, { expires: 1 });
}
export function getAgent() {
  return Cookies.get(Agent);
}
export function delAgent() {
  return Cookies.remove(Agent);
}

const ExectSetting = "ExectSetting";
export function setExectSetting(ExectSettingData) {
  return Cookies.set(ExectSetting, ExectSettingData, { expires: 1 });
}
export function getExectSetting() {
  return Cookies.get(ExectSetting);
}
export function delExectSetting() {
  return Cookies.remove(ExectSetting);
}
const applyid = "applyid";
export function setapplyid(applyidData) {
  return window.sessionStorage.setItem(applyid, applyidData);
}
export function getapplyid() {
  return window.sessionStorage.getItem(applyid);
}
export function delapplyid() {
  return window.sessionStorage.removeItem(applyid);
}

const jurisdiction = "jurisdiction";
export function setJurisdiction(jurisdictionList) {
  return Cookies.set(jurisdiction, jurisdictionList, { expires: 1 });
}
export function getJurisdiction() {
  return Cookies.get(jurisdiction);
}
export function delJurisdiction() {
  return Cookies.remove(jurisdiction);
}
const Setting = "Setting";
export function setSetting(SettingData) {
  return Cookies.set(Setting, SettingData, { expires: 1 });
}
export function getSetting() {
  return Cookies.get(Setting);
}
export function delSetting() {
  return Cookies.remove(Setting);
}
//人像权限存储
const isphoto = "isphoto";
export function setisphoto(isphotoData) {
  return Cookies.set(isphoto, isphotoData, { expires: 1 });
}
export function getisphoto() {
  return Cookies.get(isphoto);
}
export function delisphoto() {
  return Cookies.remove(isphoto);
}

//人脸存在时间   通用
const isfacetime = "isfacetime";
export function setisfacetime(isfacetimeData) {
  return Cookies.set(isfacetime, isfacetimeData, { expires: 1 });
}
export function getisfacetime() {
  return Cookies.get(isfacetime);
}
export function delisfacetime() {
  return Cookies.remove(isfacetime);
}
//人脸存在时间   模拟考试单个
const isfacetimemkface = "isfacetimemkface";
export function setisfacetimemkface(isfacetimemkfaceData) {
  return Cookies.set(isfacetimemkface, isfacetimemkfaceData, { expires: 1 });
}
export function getisfacetimemkface() {
  return Cookies.get(isfacetimemkface);
}
export function delisfacetimemkface() {
  return Cookies.remove(isfacetimemkface);
}
//人脸存在时间   正式考试单个
const isfacetimezsface = "isfacetimezsface";
export function setisfacetimezsface(isfacetimezsfaceData) {
  return Cookies.set(isfacetimezsface, isfacetimezsfaceData, { expires: 1 });
}
export function getisfacetimezsface() {
  return Cookies.get(isfacetimezsface);
}
export function delisfacetimezsface() {
  return Cookies.remove(isfacetimezsface);
}
//人脸存在时间   专项练习单个
const isfacetimezxface = "isfacetimezxface";
export function setisfacetimezxface(isfacetimezxfaceData) {
  return Cookies.set(isfacetimezxface, isfacetimezxfaceData, { expires: 1 });
}
export function getisfacetimezxface() {
  return Cookies.get(isfacetimezxface);
}
export function delisfacetimezxface() {
  return Cookies.remove(isfacetimezxface);
}
//人脸存在时间   课件学习单个
const isfacetimekjface = "isfacetimekjface";
export function setisfacetimekjface(isfacetimekjfaceData) {
  return Cookies.set(isfacetimekjface, isfacetimekjfaceData, { expires: 1 });
}
export function getisfacetimekjface() {
  return Cookies.get(isfacetimekjface);
}
export function delisfacetimekjface() {
  return Cookies.remove(isfacetimekjface);
}
//微信用户的openid
const wxopenid = "wxopenid";
export function setwxopenid(wxopenidData) {
  return Cookies.set(wxopenid, wxopenidData, { expires: 1 });
}
export function getwxopenid() {
  return Cookies.get(wxopenid);
}
export function delwxopenid() {
  return Cookies.remove(wxopenid);
}

//是否支付成功
const ispay = "ispay";
export function setispay(ispayData) {
  return Cookies.set(ispay, ispayData, { expires: 1 });
}
export function getispay() {
  return Cookies.get(ispay);
}
export function delispay() {
  return Cookies.remove(ispay);
}

//计时
const isTime = "isTime";
export function setisTime(isTimeData) {
  return Cookies.set(isTime, isTimeData, { expires: 1 });
}
export function getisTime() {
  return Cookies.get(isTime);
}
export function delisTime() {
  return Cookies.remove(isTime);
}

//学时
const LearnTime = "LearnTime";
export function setLearnTime(LearnTimeData) {
  return Cookies.set(LearnTime, LearnTimeData, { expires: 1 });
}
export function getLearnTime() {
  return Cookies.get(LearnTime);
}
export function delLearnTime() {
  return Cookies.remove(LearnTime);
}
//当前信息
const currentInfo = "currentInfo";
export function setcurrentInfo(currentInfoData) {
  return window.sessionStorage.setItem(currentInfo, currentInfoData);
}
export function getcurrentInfo() {
  return window.sessionStorage.getItem(currentInfo);
}
export function delcurrentInfo() {
  return window.sessionStorage.removeItem(currentInfo);
}

//学时
const closeWindow = "closeWindow";
export function setcloseWindow(closeWindowData) {
  return window.sessionStorage.setItem(closeWindow, closeWindowData);
}
export function getcloseWindow() {
  return window.sessionStorage.getItem(closeWindow);
}
export function delcloseWindow() {
  return window.sessionStorage.removeItem(closeWindow);
}
//学时
const wxstate = "wxstate";
export function setwxstate(wxstateData) {
  return window.sessionStorage.setItem(wxstate, wxstateData);
}
export function getwxstate() {
  return window.sessionStorage.getItem(wxstate);
}
export function delwxstate() {
  return window.sessionStorage.removeItem(wxstate);
}
const phone = "phone";
export function setPhone(phoneData) {
  return window.sessionStorage.setItem(phone, phoneData);
}
export function getPhone() {
  return window.sessionStorage.getItem(phone);
}
export function delphone() {
  return window.sessionStorage.removeItem(phone);
}

//个人信息状态
const userstate = "userstate";
export function setuserstate(stateData) {
  return window.sessionStorage.setItem(userstate, stateData);
}
export function getuserstate() {
  return window.sessionStorage.getItem(userstate);
}
export function deluserstate() {
  return window.sessionStorage.removeItem(userstate);
}

//考试信息储存
const examSetting = "examSetting";
export function setexamSetting(stateData) {
  return window.localStorage.setItem(
    examSetting,
    JSON.stringify({ data: stateData, dateTime: new Date().getTime() })
  );
}
export function getexamSetting() {
  return window.localStorage.getItem(examSetting);
}
export function delexamSetting() {
  return window.localStorage.removeItem(examSetting);
}

//教材科目信息储存
const learnObject = "learnObject";
export function setlearnObject(stateData) {
  return window.localStorage.setItem(
    learnObject,
    JSON.stringify({ data: stateData, dateTime: new Date().getTime() })
  );
}
export function getlearnObject() {
  return window.localStorage.getItem(learnObject);
}
export function dellearnObject() {
  return window.localStorage.removeItem(learnObject);
}

//位置信息储存
const placeObject = "placeObject";
export function setplaceObject(stateData) {
  return window.localStorage.setItem(
    placeObject,
    JSON.stringify({ data: stateData, dateTime: new Date().getTime() })
  );
}
export function getplaceObject() {
  return window.localStorage.getItem(placeObject);
}
export function delplaceObject() {
  return window.localStorage.removeItem(placeObject);
}

//问题反馈详情信息
const question = "question";
export function setquestion(stateData) {
  return window.localStorage.setItem(question, JSON.stringify(stateData));
}
export function getquestion() {
  return window.localStorage.getItem(question);
}
export function delquestion() {
  return window.localStorage.removeItem(question);
}

//问题反馈详情信息
const CountList = "count_list";
export function setCountList(stateData) {
  return window.localStorage.setItem(CountList, JSON.stringify(stateData));
}
export function getCountList() {
  return JSON.parse(window.localStorage.getItem(CountList));
}
export function delCountList() {
  return window.localStorage.removeItem(CountList);
}
